package com.finance.system.service;

import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import com.finance.base.exception.BaseException;
import com.finance.system.bean.pojo.Menu;
import com.finance.system.bean.pojo.User;
import com.finance.system.bean.pojo.UserRoleRel;

import java.util.List;

/**
 * Created by CBWL on 2017/3/10.
 */
public interface IUserService {

    User getById(Long id);

    User getByCode(String code);

    User getByIdWithLock(Long id);

    User getByMobile(String mobile);

    boolean verifyPass(User user, String passwd);

    boolean hasRole(User user, String roleId);

    PageResultBO<User> listByPage(Page page);

    boolean add(User user, List<Long> roleIdLong) throws BaseException;

    boolean delete(String id) throws BaseException;

    User update(User user, Long uId, List<Long> roleIds, String code) throws BaseException;

    boolean batchDel(List<String> ids) ;

    boolean addUserRole(String code, Long uId, List<Long> roleIds);

    boolean updateRoleRel(String code, Long uId, List<Long> roleIds) throws BaseException;

    Menu getMenuTree(User u);

    List<UserRoleRel> getRoleRelByUserCode(String code);

    boolean batchAdd(List<User> user);

    List<User> queryByCodes(List<String> codes);
}
